import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: ()=>import('@/views/login')
  },
  {
    path: '/',
    component: ()=>import('@/views/layout/'),
    children:[
      {
        path:'',
        name:'home',
        component: ()=>import('@/views/home/')
      },
      {
        path:'/wd',
        name:'wd',
        component: ()=>import('@/views/wd/')
      },
      {
        path:'/video',
        name:'video',
        component: ()=>import('@/views/video/')
      },
      {
        path:'/my',
        name:'my',
        component: ()=>import('@/views/my/')
      },
    ]
  },
  {
    path:'/search',
    name:'search',
    component: ()=>import('@/components/search/Searchindex')
  },
  {
    path:'/article/:articleId',
    name:'article',
    component: ()=>import('@/views/article/index'),
    props:true
  },
]

const router = new VueRouter({
  routes
})

export default router
